
<?php

function getSubCatlog($catalogId, $space, $listcatalog) {
    echo ' <ul class="dropdownmenu">';
    foreach ($listcatalog as $key => $listdata) {

        if ($listdata["catalogParent"] == $catalogId) {
            echo ' <li><a href="'.WEB_PATH.'/'.$listdata["catalogLink"].'.html" title="' . $listdata["catalogName"] . '"> <i class="fa fa-angle-right"></i> ' . $listdata["catalogName"] . '</a>';
            getSubCatlog($listdata["catalogId"], $space, $listcatalog);
            echo '</li>';
        }
    }
    echo '</ul>';
    // }
}
?>


<div class="menudesktop">
    <ul class="dropdownmenu">
        <li class="menufirst"><a href="javascript:void(0);" title=""> <i class="fa fa-bars"></i> Chuyên mục videos</a></li>
            <?php
            
            $space = "";
            foreach ($listcatalog as $key => $listdata) {
                if ($listdata["catalogParent"] == 0) {
                    echo ' <li><a href="'.WEB_PATH.'/'.$listdata["catalogLink"].'.html" title="' . $listdata["catalogName"] . '"> <i class="fa fa-angle-right"></i> ' . $listdata["catalogName"] . '</a>';
                    getSubCatlog($listdata["catalogId"], $space, $listcatalog);
                    echo '</li>';
                }
            }
        
            ?>


    </ul>
</div>
